package com.jy.bo.common.conf.enums;

/**
 * @program: binary-option
 * @description
 * @author: frank
 * @create: 2020-09-03 16:54
 **/
public enum LoginTypeEnum {

    MOBILE(0,"MOBILE"),EMAIL(1, "EMAIL");

    private Integer code;
    private String name;

    LoginTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public LoginTypeEnum setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getName() {
        return name;
    }

    public LoginTypeEnum setName(String name) {
        this.name = name;
        return this;
    }

    public static LoginTypeEnum getByCode(Integer code){
        for(LoginTypeEnum loginTypeEnum : LoginTypeEnum.values()){
            if(code == loginTypeEnum.getCode()){
                return loginTypeEnum;
            }
        }
        return null;
    }
}
